package com.offcn.dao;

import com.offcn.entity.Course_User;
import com.offcn.utlis.BaseDao;

import java.util.List;

public class Course_UserDaoImpl extends BaseDao<Course_User> implements Course_UserDao {

    /**
     *  分页查询
     * @param sql
     * @param peams
     * @return
     */
    @Override
    public List<Course_User> findAll(String sql, Object... peams) {
        return getMore(sql,Course_User.class,peams);
    }

    /**
     * 修改 选课
     * @param cid
     * @param id
     * @return
     */
    @Override
    public int updateCourse(int cid, int id) {
        return update("update course_user set cid = ? where id = ? ",cid,id);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @Override
    public int deleteByid(String id) {
        return update("delete from course_user where id = ?",id);
    }
}
